'use strict';
module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.createTable('todos', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      },
      loginName: {
        type: Sequelize.STRING
      },
      name: {
        type: Sequelize.STRING
      },
      password:{
        type: Sequelize.STRING
      },
      email: {
        type: Sequelize.STRING
      },
      phone: {
        type: Sequelize.INTEGER,
        validate:{
          len:11,
        }
      },
      createTime: {
        type: Sequelize.DATE,
      },
      status:{
        type:Sequelize.INTEGER,
      },
    });
  },
  down: (queryInterface, Sequelize) => {
    return queryInterface.dropTable('todos');
  }
};